﻿var str1=document.getElementById("jobmiddlenew").innerHTML;
var str2=str1.length;
var str3=str2/2;
var substr = str1.substring(str3, str2);

var n = substr.search("<br>");
if(n<0)
{
n = substr.indexOf('.');
if(n<0)
{
n=0;
}
var firsthalf = str1.substring(0, str3+n+1);
var secondhalf = str1.substring(str3+n+1, str2);

}
else
{

var firsthalf = str1.substring(0, str3+n+4);
var secondhalf = str1.substring(str3+n+4, str2);
}
var addcode="<center>
"+document.getElementById("addcodemiddle").innerHTML+"</center>
<br/>";

var newbody=firsthalf+addcode+secondhalf;


var strnew=document.getElementsByClassName("post-body entry-content");
strnew[0].innerHTML=newbody;

document.getElementById("addcodemiddle").innerHTML="";